using CAPHandlerAttributeDemo.Api.EventHandlers;
using DotNetCore.CAP;
using Microsoft.AspNetCore.Mvc;

namespace CAPHandlerAttributeDemo.Api.Controllers;

[ApiController]
[Route("[controller]")]
public class PublishController : ControllerBase
{
    [HttpPost("Send")]
    public IActionResult SendMessage([FromServices] ICapPublisher capBus)
    {
        capBus.Publish("test.show.time", new MessageEventSubscribe()
        {
            SendTime = DateTime.Now.AddDays(10),
        });

        return Ok();
    }
}
